package com.lovo.game;

import java.util.Scanner;

/**
 * 玩家类
 */
public class Player extends Role{
    Scanner scanner = new Scanner(System.in);

    public Player() {
    }

    public Player(String name){
        this.setName(name);
    }

    /**
     * 出拳
     * @return
     */
    public int input(){
        while (true){
            System.out.println("0：石头，1：剪刀，2：布");
            int put = scanner.nextInt();
            if (put <= 2 && put >= 0){
                return put;
            }else {
                System.out.println("输入有误。请从新输入");
            }

        }

    }


}
